package task04;

/**
 * @author yuanbinbing
 * 测试类：创建ｐｅｒｓｏｎ对象，调用对象的方法
 */
public class PersonDemo {
    public static void main(String[] args) {
        Person p1=new Person();

        //p1.name="ybb";

        p1.setName("ybb");
        String name=p1.getName();
        System.out.println(name);

       // p1.age=20;

        p1.setAge(18);
        System.out.println(+p1.getAge());

        p1.eat();
        p1.speak();
        p1.hobby();

        Person p2=new Person("张三",18);
        p2.eat();
    }
}